//Include("Mz.G");

/**
 * @fileoverview 给元素obj解除事件(evt)的处理函数handler
 * @author meizz
 * @version 20090426
 *
 * @name Mz.un
 * @namespace Mz.un

 * @param {DOM/String} obj DOM元素或者其ID
 * @param {String} type 方法的名称
 * @param {Function} handler 事件的处理函数
 * @return {DOM} 绑定事件的节点
 */
Mz.un = function(obj, type, handler) {
    if (!(obj = Mz.G(obj)) || typeof handler != "function"){ return obj;}

    type = type.replace(/^on/i, "").toLowerCase();

    if (obj.attachEvent) {
        var key = "__mz_guid";
        if (handler[key]) {
            key = 'on' + type + "_" + handler[key];
            handler = obj[key] || handler;
            obj[key] = null;
        }
        obj.detachEvent('on' + type, handler);
    } else if (obj.removeEventListener) {
        obj.removeEventListener(type, handler, false);
    }

    return obj;
};
